/*
 * Copyright 2009 Armando Blancas
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package tests.taskgraph.tasks.io;

import javax.persistence.Column;
import javax.persistence.Entity;

/**
 * For reading table 'Titles' from MySql database 'books'.
 * 
 * <p>This is the equivalent of class BookTitle, but it uses annotations
 * to define the correspondence from instance fields to columns.
 */
@Entity(name="Titles")
public class BookData {

	private String key;
	private String name;
	private int edition;
	private String notice;
	
	/**
	 * Default constructor.
	 */
	public BookData() {
		// do nothing
	}
	
	/**
	 * BookData constructor.
	 * 
	 * @param key     The book id.
	 * @param name    The book title.
	 * @param edition The edition number.
	 * @param notice  The copyright notice.
	 */
	public BookData(String key, String name, int edition, String notice) {
		setKey(key);
		setName(name);
		setEdition(edition);
		setNotice(notice);
	}

	/**
	 * @return the iSBN
	 */
	@Column(name="ISBN")
	public String getKey() {
		return key;
	}

	/**
	 * @param isbn the iSBN to set
	 */
	public void setKey(String isbn) {
		key = isbn;
	}

	/**
	 * @return the title
	 */
	@Column(name="Title")
	public String getName() {
		return name;
	}

	/**
	 * @param title the title to set
	 */
	public void setName(String title) {
		name = title;
	}

	/**
	 * @return the editionNumber
	 */
	@Column(name="EditionNumber")
	public int getEdition() {
		return edition;
	}

	/**
	 * @param editionNumber the editionNumber to set
	 */
	public void setEdition(int editionNumber) {
		edition = editionNumber;
	}

	/**
	 * @return the copyright
	 */
	@Column(name="Copyright")
	public String getNotice() {
		return notice;
	}

	/**
	 * @param copyright the copyright to set
	 */
	public void setNotice(String copyright) {
		notice = copyright;
	}
	
}
